<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Tree::Visitors::Cssize</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (C)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Tree.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree.html" title="Sass::Tree (module)">Tree</a></span> &raquo; <span class='title'><a href="Visitors.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors.html" title="Sass::Tree::Visitors (module)">Visitors</a></span>
     &raquo; 
    <span class="title">Cssize</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Tree::Visitors::Cssize 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Base.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Base.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></li>
          
            <li class="next">Sass::Tree::Visitors::Cssize</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>A visitor for converting a static Sass tree into a static CSS tree.</p>

  </div>
</div>
<div class="tags">
  
</div>
  <h2>Constant Summary</h2>
  


  
  
  
  
  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#parent-instance_method" title="#parent (instance method)">- (Tree::Node) <strong>parent</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  

  
    <span class="summary_desc">Returns the immediate parent of the current node.</span>
  
</li>

    
  </ul>


  <h2>Class Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#visit-class_method" title="visit (class method)">+ ((Tree::Node, Sass::Util::SubsetMap)) <strong>visit</strong>(root) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">The resulting tree of static nodes <em>and</em> the extensions defined for this tree.</span>
  
</li>

    
  </ul>

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Cssize) <strong>initialize</strong> </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">A new instance of Cssize.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit-instance_method" title="#visit (instance method)">- <strong>visit</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">If an exception is raised, this adds proper metadata to the backtrace.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_children-instance_method" title="#visit_children (instance method)">- <strong>visit_children</strong>(parent) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Keeps track of the current parent node.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_extend-instance_method" title="#visit_extend (instance method)">- <strong>visit_extend</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Registers an extension in the <code>@extends</code> subset map.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_import-instance_method" title="#visit_import (instance method)">- <strong>visit_import</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Modifies exception backtraces to include the imported file.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_media-instance_method" title="#visit_media (instance method)">- <strong>visit_media</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Bubbles the <code>@media</code> directive up through RuleNodes and merges it with other <code>@media</code> directives.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_prop-instance_method" title="#visit_prop (instance method)">- <strong>visit_prop</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Converts nested properties into flat properties and updates the indentation of the prop node based on the nesting level.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_root-instance_method" title="#visit_root (instance method)">- ((Tree::Node, Sass::Util::SubsetMap)) <strong>visit_root</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">In Ruby 1.8, ensures that there&#8217;s only one <code>@charset</code> directive and that it&#8217;s at the top of the document.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_rule-instance_method" title="#visit_rule (instance method)">- <strong>visit_rule</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Resolves parent references and nested selectors, and updates the indentation of the rule node based on the nesting level.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_supports-instance_method" title="#visit_supports (instance method)">- <strong>visit_supports</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Bubbles the <code>@supports</code> directive up through RuleNodes.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#visit_trace-instance_method" title="#visit_trace (instance method)">- <strong>visit_trace</strong>(node) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Asserts that all the traced children are valid in their new location.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#with_parent-instance_method" title="#with_parent (instance method)">- (Object) <strong>with_parent</strong>(parent) { ... }</a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Runs a block of code with the current parent node replaced with the given node.</span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Base.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html" title="Sass::Tree::Visitors::Base (class)">Base</a></h3>
  <p class="inherited"><a href="Base.html#node_name-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html#node_name-instance_method" title="Sass::Tree::Visitors::Base#node_name (method)">#node_name</a>, <a href="Base.html#visit_if-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Visitors/Base.html#visit_if-instance_method" title="Sass::Tree::Visitors::Base#visit_if (method)">#visit_if</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Tree::Visitors::Cssize (class)">Cssize</a></tt>) <strong>initialize</strong>  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of Cssize</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


14
15
16
17</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 14</span>

def initialize
  @parent_directives = []
  @extends = Sass::Util::SubsetMap.new
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id=""></span>
      <span id="parent-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="parent-instance_method">
  
    - (<tt><a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a></tt>) <strong>parent</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the immediate parent of the current node.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt><a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a></tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


12
13
14</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 12</span>

def parent
  @parent
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="visit-class_method">
  
    + (<tt>(<a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a>, <a href="SubsetMap.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util/SubsetMap.html" title="Sass::Util::SubsetMap (class)">Sass::Util::SubsetMap</a>)</tt>) <strong>visit</strong>(root) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>The resulting tree of static nodes <em>and</em> the extensions defined for this tree</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a></tt>)</span>
      
      
        <span class='name'>root</span>
      
      
      
        &mdash;
        The root node of the tree to visit.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>(<a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a>, <a href="SubsetMap.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util/SubsetMap.html" title="Sass::Util::SubsetMap (class)">Sass::Util::SubsetMap</a>)</tt>)</span>
      
      
      
      
        &mdash;
        The resulting tree of static nodes <em>and</em> the extensions defined for this tree
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


6</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 6</span>

def self.visit(root) super end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="visit-instance_method">
  
    - <strong>visit</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>If an exception is raised, this adds proper metadata to the backtrace.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


20
21
22
23
24
25</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 20</span>

def visit(node)
  super(node)
rescue Sass::SyntaxError => e
  e.modify_backtrace(:filename => node.filename, :line => node.line)
  raise e
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_children-instance_method">
  
    - <strong>visit_children</strong>(parent)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Keeps track of the current parent node.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


28
29
30
31
32
33</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 28</span>

def visit_children(parent)
  with_parent parent do
    parent.children = super.flatten
    parent
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_extend-instance_method">
  
    - <strong>visit_extend</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Registers an extension in the <code>@extends</code> subset map.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 113</span>

def visit_extend(node)
  node.resolved_selector.members.each do |seq|
    if seq.members.size > 1
      raise Sass::SyntaxError.new("Can't extend #{seq.to_a.join}: can't extend nested selectors")
    end

    sseq = seq.members.first
    if !sseq.is_a?(Sass::Selector::SimpleSequence)
      raise Sass::SyntaxError.new("Can't extend #{seq.to_a.join}: invalid selector")
    elsif sseq.members.any? {|ss| ss.is_a?(Sass::Selector::Parent)}
      raise Sass::SyntaxError.new("Can't extend #{seq.to_a.join}: can't extend parent selectors")
    end

    sel = sseq.members
    parent.resolved_rules.members.each do |seq|
      if !seq.members.last.is_a?(Sass::Selector::SimpleSequence)
        raise Sass::SyntaxError.new("#{seq} can't extend: invalid selector")
      end

      @extends[sel] = Extend.new(seq, sel, node, @parent_directives.dup, :not_found)
    end
  end

  []
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_import-instance_method">
  
    - <strong>visit_import</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Modifies exception backtraces to include the imported file.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


140
141
142
143
144
145
146
147</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 140</span>

def visit_import(node)
  # Don't use #visit_children to avoid adding the import node to the list of parents.
  node.children.map {|c| visit(c)}.flatten
rescue Sass::SyntaxError => e
  e.modify_backtrace(:filename => node.children.first.filename)
  e.add_backtrace(:filename => node.filename, :line => node.line)
  raise e
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_media-instance_method">
  
    - <strong>visit_media</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Bubbles the <code>@media</code> directive up through RuleNodes and merges it with other <code>@media</code> directives.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


151
152
153
154
155
156
157</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 151</span>

def visit_media(node)
  yield unless bubble(node)
  media = node.children.select {|c| c.is_a?(Sass::Tree::MediaNode)}
  node.children.reject! {|c| c.is_a?(Sass::Tree::MediaNode)}
  media = media.select {|n| n.resolved_query = n.resolved_query.merge(node.resolved_query)}
  (node.children.empty? ? [] : [node]) + media
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_prop-instance_method">
  
    - <strong>visit_prop</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Converts nested properties into flat properties and updates the indentation of the prop node based on the nesting level.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 177</span>

def visit_prop(node)
  if parent.is_a?(Sass::Tree::PropNode)
    node.resolved_name = "#{parent.resolved_name}-#{node.resolved_name}"
    node.tabs = parent.tabs + (parent.resolved_value.empty? ? 0 : 1) if node.style == :nested
  end

  yield

  result = node.children.dup
  if !node.resolved_value.empty? || node.children.empty?
    node.send(:check!)
    result.unshift(node)
  end

  result
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_root-instance_method">
  
    - (<tt>(<a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a>, <a href="SubsetMap.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util/SubsetMap.html" title="Sass::Util::SubsetMap (class)">Sass::Util::SubsetMap</a>)</tt>) <strong>visit_root</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>In Ruby 1.8, ensures that there&#8217;s only one <code>@charset</code> directive and that it&#8217;s at the top of the document.</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>(<a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a>, <a href="SubsetMap.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util/SubsetMap.html" title="Sass::Util::SubsetMap (class)">Sass::Util::SubsetMap</a>)</tt>)</span>
      
      
      
      
        &mdash;
        The resulting tree of static nodes <em>and</em> the extensions defined for this tree
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 64</span>

def visit_root(node)
  yield

  if parent.nil?
    # In Ruby 1.9 we can make all @charset nodes invisible
    # and infer the final @charset from the encoding of the final string.
    if Sass::Util.ruby1_8?
      charset = node.children.find {|c| c.is_a?(Sass::Tree::CharsetNode)}
      node.children.reject! {|c| c.is_a?(Sass::Tree::CharsetNode)}
      node.children.unshift charset if charset
    end

    imports = Sass::Util.extract!(node.children) do |c|
      c.is_a?(Sass::Tree::DirectiveNode) && !c.is_a?(Sass::Tree::MediaNode) &&
        c.resolved_value =~ /^@import /i
    end
    charset_and_index = Sass::Util.ruby1_8? &&
      node.children.each_with_index.find {|c, _| c.is_a?(Sass::Tree::CharsetNode)}
    if charset_and_index
      index = charset_and_index.last
      node.children = node.children[0..index] + imports + node.children[index+1..-1]
    else
      node.children = imports + node.children
    end
  end

  return node, @extends
rescue Sass::SyntaxError => e
  e.sass_template ||= node.template
  raise e
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_rule-instance_method">
  
    - <strong>visit_rule</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Resolves parent references and nested selectors, and updates the indentation of the rule node based on the nesting level.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 196</span>

def visit_rule(node)
  parent_resolved_rules = parent.is_a?(Sass::Tree::RuleNode) ? parent.resolved_rules : nil
  # It's possible for resolved_rules to be set if we've duplicated this node during @media bubbling
  node.resolved_rules ||= node.parsed_rules.resolve_parent_refs(parent_resolved_rules)

  yield

  rules = node.children.select {|c| c.is_a?(Sass::Tree::RuleNode) || c.bubbles?}
  props = node.children.reject {|c| c.is_a?(Sass::Tree::RuleNode) || c.bubbles? || c.invisible?}

  unless props.empty?
    node.children = props
    rules.each {|r| r.tabs += 1} if node.style == :nested
    rules.unshift(node)
  end

  rules.last.group_end = true unless parent.is_a?(Sass::Tree::RuleNode) || rules.empty?

  rules
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_supports-instance_method">
  
    - <strong>visit_supports</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Bubbles the <code>@supports</code> directive up through RuleNodes.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


160
161
162
163</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 160</span>

def visit_supports(node)
  yield unless bubble(node)
  node
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="visit_trace-instance_method">
  
    - <strong>visit_trace</strong>(node)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Asserts that all the traced children are valid in their new location.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


166
167
168
169
170
171
172
173</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 166</span>

def visit_trace(node)
  # Don't use #visit_children to avoid adding the trace node to the list of parents.
  node.children.map {|c| visit(c)}.flatten
rescue Sass::SyntaxError => e
  e.modify_backtrace(:mixin => node.name, :filename => node.filename, :line => node.line)
  e.add_backtrace(:filename => node.filename, :line => node.line)
  raise e
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="with_parent-instance_method">
  
    - (<tt>Object</tt>) <strong>with_parent</strong>(parent) { ... } <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Runs a block of code with the current parent node replaced with the given node.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt><a href="Node.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Tree/Node.html" title="Sass::Tree::Node (class)">Tree::Node</a></tt>)</span>
      
      
        <span class='name'>parent</span>
      
      
      
        &mdash;
        The new parent for the duration of the block.
      
    </li>
  
</ul>
<h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'></span>
      
      
      
      
        
        A block in which the parent is set to <code>parent</code>.
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Object</tt>)</span>
      
      
      
      
        &mdash;
        The return value of the block.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/tree/visitors/cssize.rb', line 43</span>

def with_parent(parent)
  if parent.is_a?(Sass::Tree::DirectiveNode)
    if MERGEABLE_DIRECTIVES.any? {|klass| parent.is_a?(klass)}
      old_parent_directive = @parent_directives.pop
    end
    @parent_directives.push parent
  end

  old_parent, @parent = @parent, parent
  yield
ensure
  @parent_directives.pop if parent.is_a?(Sass::Tree::DirectiveNode)
  @parent_directives.push old_parent_directive if old_parent_directive
  @parent = old_parent
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:34:03 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>